home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / 4th Dimension 6.0.6 demo / Databases / 3rd Party Internet Demos / Netlink Demo / MacOS / NetLink_examples / EB_Diagnostic / DBDiagnostics next >
Encoding:
Text File  |  1996-08-11  |  7.4 KB  |  166 lines  |  [TEXT/R*ch]

  1.   `global procedure DBDiagnostics
  2.   `DBDiagnostics allows a user to examine information regarding the
  3.   `4D database.
  4.  
  5. C_TEXT(vSubmit;vFileNum;vFieldNum)
  6. C_TEXT($FileList;$FieldList;$RFieldList)
  7. C_STRING(40;$FieldType)
  8. C_STRING(15;$FieldName;$FileName)
  9.  
  10. READ ONLY(*)
  11.  
  12. DBDHeader 
  13.  
  14. NL_GetField (vReqID;"submit";vSubmit)
  15. NL_GetField (vReqID;"File Number";vFileNum)
  16. NL_GetField (vReqID;"Field Number";vFieldNum)
  17.  
  18.   `Have we been asked to reset the display? 
  19. Case of 
  20.   : (vSubmit="Show Database Only")
  21.     vFileNum:=""
  22.     vFieldNum:=""
  23.   : ((vSubmit="Show Database and File Only") | (vSubmit="File Information"))
  24.     vFieldNum:=""
  25. End case 
  26.  
  27.   `Are we scanning the files? 
  28. Case of 
  29.   : (vSubmit="First File")
  30.     vFileNum:="1"
  31.     vFieldNum:=""
  32.   : (vSubmit="Previous File")
  33.     If (Num(vFileNum)>1)
  34.       vFileNum:=String(Num(vFileNum)-1)
  35.     Else 
  36.       vFileNum:="1"
  37.     End if 
  38.     vFieldNum:=""
  39.   : (vSubmit="Next File")
  40.     If (Num(vFileNum)<Count files)
  41.       vFileNum:=String(Num(vFileNum)+1)
  42.     Else 
  43.       vFileNum:=String(Count files)
  44.     End if 
  45.     vFieldNum:=""
  46.   : (vSubmit="Last File")
  47.     vFileNum:=String(Count files)
  48.     vFieldNum:=""
  49. End case 
  50.  
  51.   `Are we scanning the fields? 
  52. Case of 
  53.   : (vSubmit="First Field")
  54.     vFieldNum:="1"
  55.   : (vSubmit="Previous Field")
  56.     If (Num(vFieldNum)>1)
  57.       vFieldNum:=String(Num(vFieldNum)-1)
  58.     Else 
  59.       vFieldNum:="1"
  60.     End if 
  61.   : (vSubmit="Next Field")
  62.     If (Num(vFieldNum)<Count fields(Num(vFileNum)))
  63.       vFieldNum:=String(Num(vFieldNum)+1)
  64.     Else 
  65.       vFieldNum:=String(Count fields(Num(vFileNum)))
  66.     End if 
  67.   : (vSubmit="Last Field")
  68.     vFieldNum:=String(Count fields(Num(vFileNum)))
  69. End case 
  70.  
  71.   `The top section of this form contains general database information.  
  72. NL_AppendReply (vReqID;"<h2 align=center>General Database Information</h2>")
  73.  
  74. GeneralDBInfo 
  75.  
  76. NL_AppendReply (vReqID;"The database is comprised of <strong>"+String(Count files)+"</strong> files and their names are:<br>")
  77.  
  78.   `The HTML form begins here.
  79. NL_AppendReply (vReqID;"<form method="+◊quote+"post"+◊quote+" action="+◊quote+"/4D.acgi$DBDiagnostics"+◊quote+">")
  80. NL_AppendReply (vReqID;"<center>")
  81. If (vFileNum="")
  82.   NL_AppendReply (vReqID;DBFileList ("File Number";True;"";7;False)+"<br>")
  83. Else 
  84.   NL_AppendReply (vReqID;DBFileList ("File Number";True;Filename(Num(vFileNum));7;False)+"<br>")
  85. End if 
  86. NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"File Information"+◊quote+"><br>")
  87. NL_AppendReply (vReqID;"</center>")
  88. NL_AppendReply (vReqID;"<hr><p>")
  89.  
  90.   `The next section of the form contains information about a specific file
  91.   `in the database.
  92. If ((vSubmit="File Information") | (vFileNum#""))
  93.   
  94.   NL_AppendReply (vReqID;"<h3 align=center>Information Regarding File "+◊quote+Filename(Num(vFileNum))+◊quote+"</h3>")
  95.   
  96.   GeneralFileInfo (Num(vFileNum))
  97.   
  98.   NL_AppendReply (vReqID;"The file is comprised of <strong>"+String(Count fields(Num(vFileNum)))+"</strong> fields and their names are:<br>")
  99.   NL_AppendReply (vReqID;"<center>")
  100.   If (vFieldNum="")
  101.     NL_AppendReply (vReqID;DBFieldNameList (Num(vFileNum);"Field Number";True;"";7;False)+"<br>")
  102.   Else 
  103.     NL_AppendReply (vReqID;DBFieldNameList (Num(vFileNum);"Field Number";True;Fieldname(Num(vFileNum);Num(vFieldNum));7;False)+"<br>")
  104.   End if 
  105.   NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Field Information"+◊quote+"><br>")
  106.   
  107.   If (Count files>1)
  108.     Case of 
  109.       : (Num(vFileNum)=1)
  110.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next File"+◊quote+">")
  111.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last File"+◊quote+"><br>")
  112.       : (Num(vFileNum)=Count files)
  113.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First File"+◊quote+">")
  114.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous File"+◊quote+"><br>")
  115.       Else 
  116.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First File"+◊quote+">")
  117.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous File"+◊quote+">")
  118.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next File"+◊quote+">")
  119.         NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last File"+◊quote+"><br>")
  120.     End case 
  121.   End if   `Count files>1    
  122.   NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Show Database Only"+◊quote+"><br>")
  123.   NL_AppendReply (vReqID;"</center>")
  124.   
  125.   NL_AppendReply (vReqID;"<hr><p>")
  126.   
  127.     `The next section of the form contains information about a specific field
  128.     `within a specific file in the database.
  129.   If ((vSubmit="Field Information") | (vFieldNum#""))
  130.     
  131.     $FileName:=Filename(Num(vFileNum))
  132.     $FieldName:=Fieldname(Num(vFileNum);Num(vFieldNum))
  133.     NL_AppendReply (vReqID;"<h3 align=center>Information Regarding Field "+◊quote+$FieldName+◊quote+" in File "+◊quote+$FileName+◊quote+"</h3>")
  134.     
  135.     FieldAttributes (Num(vFileNum);Num(vFieldNum))
  136.     
  137.     NL_AppendReply (vReqID;"<center>")
  138.     If (Count fields(Num(vFileNum))>1)
  139.       NL_AppendReply (vReqID;"<br>")
  140.       Case of 
  141.         : (Num(vFieldNum)=1)
  142.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next Field"+◊quote+">")
  143.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last Field"+◊quote+"><br>")
  144.         : (Num(vFieldNum)=Count fields(Num(vFileNum)))
  145.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First Field"+◊quote+">")
  146.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous Field"+◊quote+"><br>")
  147.         Else 
  148.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"First Field"+◊quote+">")
  149.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Previous Field"+◊quote+">")
  150.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Next Field"+◊quote+">")
  151.           NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Last Field"+◊quote+"><br>")
  152.       End case 
  153.     End if   `Count fields>1
  154.     
  155.     NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Show Database Only"+◊quote+">")
  156.     NL_AppendReply (vReqID;"<input type="+◊quote+"submit"+◊quote+" name="+◊quote+"submit"+◊quote+" value="+◊quote+"Show Database and File Only"+◊quote+"><br>")
  157.     NL_AppendReply (vReqID;"</center>")
  158.     
  159.   End if   `vSubmit="Field Information"
  160. End if   `vSubmit="File Information"
  161.  
  162. NL_AppendReply (vReqID;"<input type="+◊quote+"reset"+◊quote+" value="+◊quote+"Reset"+◊quote+">")
  163. NL_AppendReply (vReqID;"</form>")
  164.  
  165. DBDFooter 
  166.